{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "2bbac9ae",
   "metadata": {},
   "source": [
    "* 记录人：贺雪\n",
    "* 时间:2021-12-06\n",
    "* week15\n",
    "* 主要参考文档\n",
    ">1.Python官方文档       \n",
    ">2.博客--函数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ae012845",
   "metadata": {},
   "source": [
    "# 上周回顾\n",
    ">1.函数的定义：def   \n",
    ">2.函数名的定义规则-->变量名一样的规则   \n",
    ">3.调用函数的方式    \n",
    ">4.参数：\n",
    ">>1.形式参数（定义函数）   \n",
    ">>2.实际参数（调用函数）   \n",
    ">>3.有多个参数时：\n",
    ">>>0.关键词参数   \n",
    ">>>1.位置参数（调用函数时）--->关键字参数要均放在末尾（多个不考虑顺序）   \n",
    ">>>2.默认参数（定义函数时）---> 默认参数均放在末尾（多个不考虑顺序）\n",
    "\n",
    "# 本周知识\n",
    ">1. 函数的返回值\n",
    ">2.函数的参数类型\n",
    ">3.模块与函数的关系\n",
    ">4.定义一个模块，然后调用模块   \n",
    ">>1.调用模块      \n",
    ">>2.调用模块中的函数    \n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "90ec8354",
   "metadata": {},
   "source": [
    "## 1. 函数的返回值\n",
    "\n",
    ">1. 返回值的关键字：return\n",
    ">2. 在其他的编程语言中，一般return一定要写，不写会报错，但是在python中，return可以不写，return默认为None\n",
    ">>1. 编程语言中的函数，一定有返回值   \n",
    ">>2. 返回值的结果是一个值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "774f5c37",
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_forrmatted_name(first_name,last_name):\n",
    "    \"\"\"返回整洁的姓名\"\"\"\n",
    "    full_name = first_name +''+last_name\n",
    "    # 函数的返回结果为full_name\n",
    "    return full_name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "303b1bf4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'LiHua'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_forrmatted_name(\"Li\",\"Hua\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4f8053e5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LiHua\n",
      "None\n"
     ]
    }
   ],
   "source": [
    "musician = get_forrmatted_name(\"Li\",\"Hua\")\n",
    "print(musician)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "705e1e9a",
   "metadata": {},
   "source": [
    "## 2. 函数的参数\n",
    "### 1. 函数输入的参数\n",
    ">1.函数式可以输入复杂的参数的\n",
    ">>1.函数参数为列表     \n",
    ">>2.函数参数为字典   \n",
    ">2.传递任意数量的实参                        \n",
    ">>1.* args     \n",
    ">>2.* kwargs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "2a8dc4d4",
   "metadata": {},
   "outputs": [],
   "source": [
    "def list_test(names):\n",
    "    \"\"\"函数输入一个列表\"\"\"\n",
    "    print(names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "36cec320",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['Lihua', 'Ziqi', 'Xiaofeng']\n"
     ]
    }
   ],
   "source": [
    "list_test([\"Lihua\",\"Ziqi\",\"Xiaofeng\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "a0db44da",
   "metadata": {},
   "outputs": [],
   "source": [
    "def dict_test(request_headers):\n",
    "    \"\"\"函数输入一个字典\"\"\"\n",
    "    print(request_headers)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "01d9c7eb",
   "metadata": {},
   "outputs": [],
   "source": [
    "# http://httpbin.org/get\n",
    "httpbin_get = {\n",
    "  \"args\": {}, \n",
    "  \"headers\": {\n",
    "    \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\", \n",
    "    \"Accept-Encoding\": \"gzip, deflate\", \n",
    "    \"Accept-Language\": \"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6\", \n",
    "    \"Host\": \"httpbin.org\", \n",
    "    \"Upgrade-Insecure-Requests\": \"1\", \n",
    "    \"User-Agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43\", \n",
    "    \"X-Amzn-Trace-Id\": \"Root=1-61ad740c-566d54aa4ee5428c46bccde5\"\n",
    "  }, \n",
    "  \"origin\": \"112.96.195.188\", \n",
    "  \"url\": \"http://httpbin.org/get\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "9d1efb52",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6', 'Host': 'httpbin.org', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36 Edg/96.0.1054.43', 'X-Amzn-Trace-Id': 'Root=1-61ad740c-566d54aa4ee5428c46bccde5'}\n"
     ]
    }
   ],
   "source": [
    "# 调用函数时，给一个字典作为输入值\n",
    "dict_test(httpbin_get[\"headers\"])"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bec280a3",
   "metadata": {},
   "source": [
    ">2.传递任意数量的实参     \n",
    ">>1.* args    \n",
    ">>>1.args可以接受多个数据（单值）     \n",
    ">>>2.args将多个数据存在一个**元组**当中，实际还是一个变量      \n",
    ">>2.** kwargs                            \n",
    ">>>1.kwargs可以接受多个数据（键值对）==>关键字参数           \n",
    ">>>2.kwargs将多个键值对的数据存放在一个字典中，实际上还是一个变量  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "d0b8d1a2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('mushroom', 'green peppers', 'extra cheese')"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 回顾元组的定义\n",
    "toppings = \"mushroom\",\"green peppers\",\"extra cheese\"\n",
    "toppings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "96127bfa",
   "metadata": {},
   "outputs": [],
   "source": [
    "# * args 实践：\n",
    "def make_food(food,*toppings):\n",
    "    \"\"\"打印顾客点的所有配料\"\"\"\n",
    "    return food,toppings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "1a9987fe",
   "metadata": {},
   "outputs": [],
   "source": [
    "build_food = make_food(\"pizza\",\"mushroom\",\"green peppers\",\"extra cheese\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "e5903a1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('pizza', ('mushroom', 'green peppers', 'extra cheese'))"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "build_food"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "3365285e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# **kwargs 实践\n",
    "def person(name,**info):\n",
    "    \"\"\"打印个人的信息\"\"\"\n",
    "    return name,info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "f302e8cf",
   "metadata": {},
   "outputs": [],
   "source": [
    "build_person = person(\"Lihua\",age=18,job=\"student\",address=\"广州南方学院\",e_mail=\"123456@qq.com\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "79111203",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('Lihua', {'age': 18, 'job': 'student', 'address': '广州南方学院', 'e_mail': '123456@qq.com'})\n"
     ]
    }
   ],
   "source": [
    "print(build_person)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f8fea833",
   "metadata": {},
   "source": [
    "### 2. 函数返回的结果\n",
    "\n",
    ">1.函数可以返回任意类型的值，包括列表、字典和集合等较为复杂的数据结构\n",
    ">>1. 函数返回一个集合\n",
    ">>2. 函数返回一个字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "71a9cffd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 返回值为一个集合\n",
    "def search4vowels(word):\n",
    "    \"\"\"Return a boolean based on any vowels found\"\"\"\n",
    "    vowels = set('aeiou')\n",
    "    found = vowels.intersection(set(word))\n",
    "    return found\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e508dc83",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'e', 'u', 'o'}\n"
     ]
    }
   ],
   "source": [
    "word = search4vowels('hello hexue')\n",
    "print(word)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "c991e6dd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 返回值为一个字典\n",
    "def build_person(name,age,job):\n",
    "    \"\"\"返回一个字典，其中包含有关一个人的信息\"\"\"\n",
    "    person = {'name':name,'age':age,'job':job}\n",
    "    return person"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "908efa2f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'name': 'Lihua', 'age': 18, 'job': 'student'}\n"
     ]
    }
   ],
   "source": [
    "person = build_person(\"Lihua\",18,\"student\")\n",
    "print(person)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "00f4e26d",
   "metadata": {},
   "source": [
    "## 3.模块\n",
    "\n",
    "> 1.模块  用户都不需要看底层代码      \n",
    "> 2.调用模块的方法            \n",
    ">>1. 必须先调用模块，才可以使用                                                           \n",
    ">>>1.import moudle_name 直接调用整个模块，此时模块的所有函数处于备用状态，使用的方法为：moudle_name.func_name()        \n",
    ">>>2. from moudle_name import func_name,此时，仅调用模块的某一个函数，只能使用这个模块的该函数，使用方法为func_name()       "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "f96e1314",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践：抓取某个校园新闻的所有文本链接---广州南方学院为例\n",
    "\n",
    "url = \"https://www.nfu.edu.cn/\"\n",
    "\n",
    "def news_链接(url,新闻分类,page):\n",
    "    \"\"\"抓取学校新闻的所有链接\"\"\"\n",
    "    news_链接 = []\n",
    "    for i in range(0,int(page)):\n",
    "        if i == 0:\n",
    "            index_链接 = url+新闻分类+'index.htm'\n",
    "            news_链接.append(index_链接)\n",
    "        else:\n",
    "            index_链接 = url + 新闻分类 + '/index'+str(i)+'.htm'\n",
    "            news_链接.append(index_链接)\n",
    "    return news_链接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "84f3abfb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['https://www.nfu.edu.cn/xxywindex.htm', 'https://www.nfu.edu.cn/xxyw/index1.htm', 'https://www.nfu.edu.cn/xxyw/index2.htm', 'https://www.nfu.edu.cn/xxyw/index3.htm', 'https://www.nfu.edu.cn/xxyw/index4.htm', 'https://www.nfu.edu.cn/xxyw/index5.htm', 'https://www.nfu.edu.cn/xxyw/index6.htm', 'https://www.nfu.edu.cn/xxyw/index7.htm', 'https://www.nfu.edu.cn/xxyw/index8.htm', 'https://www.nfu.edu.cn/xxyw/index9.htm', 'https://www.nfu.edu.cn/xxyw/index10.htm', 'https://www.nfu.edu.cn/xxyw/index11.htm', 'https://www.nfu.edu.cn/xxyw/index12.htm', 'https://www.nfu.edu.cn/xxyw/index13.htm', 'https://www.nfu.edu.cn/xxyw/index14.htm', 'https://www.nfu.edu.cn/xxyw/index15.htm', 'https://www.nfu.edu.cn/xxyw/index16.htm', 'https://www.nfu.edu.cn/xxyw/index17.htm', 'https://www.nfu.edu.cn/xxyw/index18.htm', 'https://www.nfu.edu.cn/xxyw/index19.htm', 'https://www.nfu.edu.cn/xxyw/index20.htm', 'https://www.nfu.edu.cn/xxyw/index21.htm', 'https://www.nfu.edu.cn/xxyw/index22.htm', 'https://www.nfu.edu.cn/xxyw/index23.htm', 'https://www.nfu.edu.cn/xxyw/index24.htm', 'https://www.nfu.edu.cn/xxyw/index25.htm', 'https://www.nfu.edu.cn/xxyw/index26.htm', 'https://www.nfu.edu.cn/xxyw/index27.htm', 'https://www.nfu.edu.cn/xxyw/index28.htm', 'https://www.nfu.edu.cn/xxyw/index29.htm', 'https://www.nfu.edu.cn/xxyw/index30.htm', 'https://www.nfu.edu.cn/xxyw/index31.htm', 'https://www.nfu.edu.cn/xxyw/index32.htm', 'https://www.nfu.edu.cn/xxyw/index33.htm', 'https://www.nfu.edu.cn/xxyw/index34.htm', 'https://www.nfu.edu.cn/xxyw/index35.htm', 'https://www.nfu.edu.cn/xxyw/index36.htm', 'https://www.nfu.edu.cn/xxyw/index37.htm', 'https://www.nfu.edu.cn/xxyw/index38.htm', 'https://www.nfu.edu.cn/xxyw/index39.htm', 'https://www.nfu.edu.cn/xxyw/index40.htm', 'https://www.nfu.edu.cn/xxyw/index41.htm', 'https://www.nfu.edu.cn/xxyw/index42.htm', 'https://www.nfu.edu.cn/xxyw/index43.htm', 'https://www.nfu.edu.cn/xxyw/index44.htm', 'https://www.nfu.edu.cn/xxyw/index45.htm', 'https://www.nfu.edu.cn/xxyw/index46.htm', 'https://www.nfu.edu.cn/xxyw/index47.htm', 'https://www.nfu.edu.cn/xxyw/index48.htm', 'https://www.nfu.edu.cn/xxyw/index49.htm', 'https://www.nfu.edu.cn/xxyw/index50.htm', 'https://www.nfu.edu.cn/xxyw/index51.htm', 'https://www.nfu.edu.cn/xxyw/index52.htm', 'https://www.nfu.edu.cn/xxyw/index53.htm', 'https://www.nfu.edu.cn/xxyw/index54.htm', 'https://www.nfu.edu.cn/xxyw/index55.htm', 'https://www.nfu.edu.cn/xxyw/index56.htm', 'https://www.nfu.edu.cn/xxyw/index57.htm', 'https://www.nfu.edu.cn/xxyw/index58.htm', 'https://www.nfu.edu.cn/xxyw/index59.htm', 'https://www.nfu.edu.cn/xxyw/index60.htm', 'https://www.nfu.edu.cn/xxyw/index61.htm', 'https://www.nfu.edu.cn/xxyw/index62.htm', 'https://www.nfu.edu.cn/xxyw/index63.htm', 'https://www.nfu.edu.cn/xxyw/index64.htm', 'https://www.nfu.edu.cn/xxyw/index65.htm', 'https://www.nfu.edu.cn/xxyw/index66.htm', 'https://www.nfu.edu.cn/xxyw/index67.htm', 'https://www.nfu.edu.cn/xxyw/index68.htm', 'https://www.nfu.edu.cn/xxyw/index69.htm', 'https://www.nfu.edu.cn/xxyw/index70.htm', 'https://www.nfu.edu.cn/xxyw/index71.htm', 'https://www.nfu.edu.cn/xxyw/index72.htm', 'https://www.nfu.edu.cn/xxyw/index73.htm', 'https://www.nfu.edu.cn/xxyw/index74.htm', 'https://www.nfu.edu.cn/xxyw/index75.htm', 'https://www.nfu.edu.cn/xxyw/index76.htm', 'https://www.nfu.edu.cn/xxyw/index77.htm', 'https://www.nfu.edu.cn/xxyw/index78.htm', 'https://www.nfu.edu.cn/xxyw/index79.htm', 'https://www.nfu.edu.cn/xxyw/index80.htm', 'https://www.nfu.edu.cn/xxyw/index81.htm', 'https://www.nfu.edu.cn/xxyw/index82.htm', 'https://www.nfu.edu.cn/xxyw/index83.htm', 'https://www.nfu.edu.cn/xxyw/index84.htm', 'https://www.nfu.edu.cn/xxyw/index85.htm', 'https://www.nfu.edu.cn/xxyw/index86.htm', 'https://www.nfu.edu.cn/xxyw/index87.htm', 'https://www.nfu.edu.cn/xxyw/index88.htm', 'https://www.nfu.edu.cn/xxyw/index89.htm', 'https://www.nfu.edu.cn/xxyw/index90.htm', 'https://www.nfu.edu.cn/xxyw/index91.htm', 'https://www.nfu.edu.cn/xxyw/index92.htm', 'https://www.nfu.edu.cn/xxyw/index93.htm', 'https://www.nfu.edu.cn/xxyw/index94.htm', 'https://www.nfu.edu.cn/xxyw/index95.htm', 'https://www.nfu.edu.cn/xxyw/index96.htm', 'https://www.nfu.edu.cn/xxyw/index97.htm']\n"
     ]
    }
   ],
   "source": [
    "# 使用者只需提供：url链接，学校分类的简称，页码 \n",
    "result = news_链接('https://www.nfu.edu.cn/','xxyw',98)\n",
    "print(result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "592c96a6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['https://www.nfu.edu.cn/xxdtindex.htm', 'https://www.nfu.edu.cn/xxdt/index1.htm', 'https://www.nfu.edu.cn/xxdt/index2.htm', 'https://www.nfu.edu.cn/xxdt/index3.htm', 'https://www.nfu.edu.cn/xxdt/index4.htm', 'https://www.nfu.edu.cn/xxdt/index5.htm', 'https://www.nfu.edu.cn/xxdt/index6.htm', 'https://www.nfu.edu.cn/xxdt/index7.htm', 'https://www.nfu.edu.cn/xxdt/index8.htm', 'https://www.nfu.edu.cn/xxdt/index9.htm', 'https://www.nfu.edu.cn/xxdt/index10.htm', 'https://www.nfu.edu.cn/xxdt/index11.htm', 'https://www.nfu.edu.cn/xxdt/index12.htm', 'https://www.nfu.edu.cn/xxdt/index13.htm', 'https://www.nfu.edu.cn/xxdt/index14.htm', 'https://www.nfu.edu.cn/xxdt/index15.htm', 'https://www.nfu.edu.cn/xxdt/index16.htm', 'https://www.nfu.edu.cn/xxdt/index17.htm', 'https://www.nfu.edu.cn/xxdt/index18.htm', 'https://www.nfu.edu.cn/xxdt/index19.htm', 'https://www.nfu.edu.cn/xxdt/index20.htm', 'https://www.nfu.edu.cn/xxdt/index21.htm', 'https://www.nfu.edu.cn/xxdt/index22.htm', 'https://www.nfu.edu.cn/xxdt/index23.htm', 'https://www.nfu.edu.cn/xxdt/index24.htm', 'https://www.nfu.edu.cn/xxdt/index25.htm', 'https://www.nfu.edu.cn/xxdt/index26.htm', 'https://www.nfu.edu.cn/xxdt/index27.htm', 'https://www.nfu.edu.cn/xxdt/index28.htm', 'https://www.nfu.edu.cn/xxdt/index29.htm', 'https://www.nfu.edu.cn/xxdt/index30.htm', 'https://www.nfu.edu.cn/xxdt/index31.htm', 'https://www.nfu.edu.cn/xxdt/index32.htm', 'https://www.nfu.edu.cn/xxdt/index33.htm', 'https://www.nfu.edu.cn/xxdt/index34.htm', 'https://www.nfu.edu.cn/xxdt/index35.htm', 'https://www.nfu.edu.cn/xxdt/index36.htm', 'https://www.nfu.edu.cn/xxdt/index37.htm', 'https://www.nfu.edu.cn/xxdt/index38.htm', 'https://www.nfu.edu.cn/xxdt/index39.htm', 'https://www.nfu.edu.cn/xxdt/index40.htm', 'https://www.nfu.edu.cn/xxdt/index41.htm', 'https://www.nfu.edu.cn/xxdt/index42.htm', 'https://www.nfu.edu.cn/xxdt/index43.htm', 'https://www.nfu.edu.cn/xxdt/index44.htm', 'https://www.nfu.edu.cn/xxdt/index45.htm', 'https://www.nfu.edu.cn/xxdt/index46.htm', 'https://www.nfu.edu.cn/xxdt/index47.htm', 'https://www.nfu.edu.cn/xxdt/index48.htm', 'https://www.nfu.edu.cn/xxdt/index49.htm', 'https://www.nfu.edu.cn/xxdt/index50.htm', 'https://www.nfu.edu.cn/xxdt/index51.htm', 'https://www.nfu.edu.cn/xxdt/index52.htm', 'https://www.nfu.edu.cn/xxdt/index53.htm', 'https://www.nfu.edu.cn/xxdt/index54.htm', 'https://www.nfu.edu.cn/xxdt/index55.htm', 'https://www.nfu.edu.cn/xxdt/index56.htm', 'https://www.nfu.edu.cn/xxdt/index57.htm', 'https://www.nfu.edu.cn/xxdt/index58.htm', 'https://www.nfu.edu.cn/xxdt/index59.htm', 'https://www.nfu.edu.cn/xxdt/index60.htm', 'https://www.nfu.edu.cn/xxdt/index61.htm', 'https://www.nfu.edu.cn/xxdt/index62.htm', 'https://www.nfu.edu.cn/xxdt/index63.htm', 'https://www.nfu.edu.cn/xxdt/index64.htm', 'https://www.nfu.edu.cn/xxdt/index65.htm', 'https://www.nfu.edu.cn/xxdt/index66.htm', 'https://www.nfu.edu.cn/xxdt/index67.htm', 'https://www.nfu.edu.cn/xxdt/index68.htm', 'https://www.nfu.edu.cn/xxdt/index69.htm', 'https://www.nfu.edu.cn/xxdt/index70.htm', 'https://www.nfu.edu.cn/xxdt/index71.htm', 'https://www.nfu.edu.cn/xxdt/index72.htm', 'https://www.nfu.edu.cn/xxdt/index73.htm', 'https://www.nfu.edu.cn/xxdt/index74.htm', 'https://www.nfu.edu.cn/xxdt/index75.htm', 'https://www.nfu.edu.cn/xxdt/index76.htm', 'https://www.nfu.edu.cn/xxdt/index77.htm', 'https://www.nfu.edu.cn/xxdt/index78.htm', 'https://www.nfu.edu.cn/xxdt/index79.htm', 'https://www.nfu.edu.cn/xxdt/index80.htm', 'https://www.nfu.edu.cn/xxdt/index81.htm', 'https://www.nfu.edu.cn/xxdt/index82.htm', 'https://www.nfu.edu.cn/xxdt/index83.htm', 'https://www.nfu.edu.cn/xxdt/index84.htm', 'https://www.nfu.edu.cn/xxdt/index85.htm', 'https://www.nfu.edu.cn/xxdt/index86.htm', 'https://www.nfu.edu.cn/xxdt/index87.htm', 'https://www.nfu.edu.cn/xxdt/index88.htm', 'https://www.nfu.edu.cn/xxdt/index89.htm', 'https://www.nfu.edu.cn/xxdt/index90.htm', 'https://www.nfu.edu.cn/xxdt/index91.htm', 'https://www.nfu.edu.cn/xxdt/index92.htm', 'https://www.nfu.edu.cn/xxdt/index93.htm', 'https://www.nfu.edu.cn/xxdt/index94.htm', 'https://www.nfu.edu.cn/xxdt/index95.htm']\n"
     ]
    }
   ],
   "source": [
    "校园动态_result = news_链接('https://www.nfu.edu.cn/','xxdt',96)\n",
    "print(校园动态_result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a70137bb",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
